package com.ruoyi.common.utils.sqlite;

import org.springframework.jdbc.core.JdbcTemplate;

import javax.sql.DataSource;

public class JdbcFactory {

	public static Jdbc getJdbc(String dbPath) {
		DataSource dataSource = new DataSourceSqliteImpl(dbPath);
		JdbcTemplate jdbcTemplate = new JdbcTemplate(dataSource);
		Jdbc jdbc = new JdbcSQLliteImpl();
		jdbc.setJdbcTemplate(jdbcTemplate);
		return jdbc;
	}

	public static void main(String[] args) {
		Jdbc jdbc = getJdbc("/Users/jackyshi/Documents/workspace_python/biuu-spider/biuuspider/client/zidian/zidian_full.db");
		jdbc.execute("show tables");
	}
}
